﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AppConfigReader.cs" company="">
//   
// </copyright>
// <summary>
//   App.config olvasására
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace DbDiff.Common.Helper
{
    using System.Configuration;

    /// <summary>
    /// App.config olvasására
    /// </summary>
    internal static class AppConfig 
    {
        
        /// <summary>
        /// The get value.
        /// </summary>
        /// <param name="key">
        /// The key.
        /// </param>
        /// <param name="defaultValue">
        /// The default value.
        /// </param>
        /// <returns>
        /// The get value.
        /// </returns>
        public static string GetValue(string key, string defaultValue)
        {
            string retval;

            try 
            {
                var asr = new AppSettingsReader();

                retval = (string)asr.GetValue(key, typeof(string));
            }
            catch 
            {
                retval = defaultValue;
            }
            
            return retval;
        }
    }
}